package exception;

public class ThrowDemo {
    public static void main(String[] args) {
        Person person = new Person();
//        person.setAge(1000);
        try {
            person.setAge(1000);
        } catch (IllagalAgeException e) {
            e.printStackTrace();
            System.out.println(e.getMessage());
        }
        System.out.println("此人年龄:"+ person.getAge());
    }
}
